pkgname=transponders
pkgver=20070503
pkgrel=1
arch=('i686')
pkgdesc="Definitions of satellite transponders"
url="http://www.kingofsat.net/"
license=('custom')
depends=()
makedepends=('curl' 'hd2u')
source=()
md5sums=()

build() {
  cd $startdir/src

  curl http://en.kingofsat.net/satellites.php 2> /dev/null | grep 'dl.php?pos=' | cut -d '"' -f 3 | while read position; do
    curl -o position.tmp -D headers.tmp "http://en.kingofsat.net/$position" && \
    dos2unix position.tmp && dos2unix headers.tmp &&
    mv -f position.tmp `grep filename headers.tmp | cut -d = -f 2`
  done

  install -m 755 -d $startdir/pkg/usr/share/transponders
  install -m 644 *.ini $startdir/pkg/usr/share/transponders
}
